<?php
namespace app\product\admin;
use app\system\admin\Admin;
use app\product\model\Cate as CateModel;

class Cate extends Admin
{
    protected $hisiModel = 'Cate';//模型名称[通用添加、修改专用]
    protected $hisiTable = '';//表名称[通用添加、修改专用]
    protected $hisiAddScene = '';//添加数据验证场景名
    protected $hisiEditScene = '';//更新数据验证场景名
    protected function initialize()
    {
        parent::initialize();
        if ($this->request->action() != 'index' && !$this->request->isPost()) {
            $category = CateModel::getSelect(CateModel::getChilds());
            $this->assign('category', $category);
        }
    }
    public function index()
    {
        $data_list = CateModel::getChilds(0, 0);

        $this->assign('data_list', $data_list);


        // 分组切换类型 0无需分组切换，1单个分组，2多个分组切换[无链接]，3多个分组切换[有链接]，具体请看application/example/view/layout.html
        $this->assign('hisiTabType', 0);
        // tab切换数据
        // $hisiTabData = [
        //     ['title' => '后台首页', 'url' => 'system/index/index'],
        // ];
        // current 可不传
        // $this->assign('hisiTabData', ['menu' => $hisiTabData, 'current' => 'system/index/index']);
        $this->assign('hisiTabData', '');
        return $this->fetch();
    }
}
